package com.itbaizhan.service;

import com.itbaizhan.dao.UserDao;
import com.itbaizhan.domain.User;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

//    @Autowired
//    private SqlSessionTemplate sqlSession;
    @Autowired
    private UserDao userDao;

    public List<User> findAll(){
//        UserDao mapper = sqlSession.getMapper(UserDao.class);
        List<User> all = userDao.findAll();
        all.forEach(System.out::println);
        return all;
    }
}
